package com.woniuxy.personal.core.controller;


import com.woniuxy.common.CommonResult;
import com.woniuxy.personal.core.model.PmComplain;
import com.woniuxy.personal.core.service.PmComplainService;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author gmx
 * @since 2021-06-29
 */
@Api(tags = "投诉相关接口")
@RestController
@RequestMapping("/complain")
public class PmComplainController {
    @Resource
    PmComplainService complainService;
    /**
     * Description : 投诉
     * ChangeLog : 1. 创建 (2021/7/2 15:16 [fulang]);
     * @param complain
     * @return com.woniuxy.common.CommonResult
    */
    @ApiOperation(value = "投诉")
    @PostMapping("complain")
    public CommonResult insert(@RequestBody PmComplain complain) {
        int i = complainService.insert(complain);
        if (i > 0) {
            return CommonResult.success();
        }
        return CommonResult.fail("投诉失败");
    }

}

